<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utg-8">
<title>Insert title here</title>
</head>
<body>
	<div id="password_edit" class="panel-body">
				
			<form class="form-horizontal" role="form" onsubmit="javascript:return false;">

				<div class="form-group">
					<input  v-model="newPwd1" type="password" class="form-control"  placeholder="请输入新密码">
				</div>
				<div class="form-group">
					<input  v-model="newPwd2" type="password" class="form-control"  placeholder="请再次输入新密码">
				</div>
			</form>
			<div class="pull-right">			
			<!--  <button @click="back" disable type="button" class="btn btn-info">返回</button>-->
			<button @click="submit" type="button" class="btn btn-info">确定</button>
			</div>
		</div>
</body>
<script type="text/javascript">
	new Vue({
	
		el : '#password_edit',
		data:{
			newPwd1:'',
			newPwd2:''
		},
		methods:{
			back:function(){
				showInit();
			},
			submit:function(){
				if(this.newPwd1=='' || this.newPwd2==''){
					alert('输入不能为空');
					return ;
				}
				if(this.newPwd1 != this.newPwd2){
					alert('两次新密码输入不一致');
					return ;
				}
				$.ajax({
					url:'<%=request.getContextPath()%>/e/edit/password/do',
					type:'post',
					data:'employeeId='+employee.id+'&'+'password='+this.newPwd1,
					success:function(result){
						alert('修改成功，请重新登陆');
						window.location.href='<%=request.getContextPath()%>/logout/go';
					}
				});
				
				
			}
		}
	});
</script>
</html>